﻿Imports System.ComponentModel.DataAnnotations

Namespace Authorization

    Public Class UserModel

        <Required>
        <Display(Name:="User name")>
        Public Property UserName() As String
            Get
                Return m_UserName
            End Get
            Set(value As String)
                m_UserName = value
            End Set
        End Property
        Private m_UserName As String

        <Required>
        <StringLength(100, ErrorMessage:="The {0} must be at least {2} characters long.", MinimumLength:=6)>
        <DataType(DataType.Password)>
        <Display(Name:="Password")>
        Public Property Password() As String
            Get
                Return m_Password
            End Get
            Set(value As String)
                m_Password = value
            End Set
        End Property
        Private m_Password As String

        <DataType(DataType.Password)>
        <Display(Name:="Confirm password")>
        <Compare("Password", ErrorMessage:="The password and confirmation password do not match.")>
        Public Property ConfirmPassword() As String
            Get
                Return m_ConfirmPassword
            End Get
            Set(value As String)
                m_ConfirmPassword = value
            End Set
        End Property
        Private m_ConfirmPassword As String
    End Class
End NameSpace